<?php
/**
 * Created by PhpStorm.
 * User: mojie126
 * Date: 2017/9/7 0007
 * Time: 下午 16:56
 */

namespace app\backend\controller;


use app\index\controller\Base;
use think\Session;

class BackendBase extends Base
{
	public function _initialize()
	{
		$this->checkAccess(0, "/backend");
		if (empty(Session::get("uid"))) {
			if (preg_match("/signup/i", getFullURL())) {
				$return = "";
			} else {
				$return = getFullURL();
			}
			$this->error("还未登录，请先登录", "/index/login?r=$return");
		}

		//获取当前页面pid为0的菜单项地址，并在相应的菜单项修添加<li>标签属性class="am-active"
	}

	public function jsonReturnLayUI($code = 0, $msg = "", $count = 0, $data = [])
	{
		$result["code"] = $code;
		$result["msg"] = $msg;
		$result["count"] = $count;
		$result["data"] = $data;
		echo json_encode($result);
		exit;
	}
}